#include <iostream>
using namespace std;

class Goods {
  public:
    Goods(int w) : weight(w) { totalWeight = totalWeight + w; }
    Goods(const Goods &g) {
        weight = g.weight;
        totalWeight = totalWeight + weight;
    }
    ~Goods() { totalWeight = totalWeight - weight; }
    void Print() const;
    static int GetTotalWeight() { return totalWeight; }

  private:
    int weight;
    static int totalWeight;
};

int Goods::totalWeight = 0;

void Goods::Print() const {
    cout << this->weight << "  " << this->totalWeight << "  ";
}

int main() {
    Goods g1(6);
    g1.Print();

    Goods g2(g1);
    g2.Print();

    cout << Goods::GetTotalWeight();
    cout << endl;

    return 0;
}
